ITI 1120 Winter 2013 - Assignment 1

Available: Jan 16, 2013
Due: Fri, Feb 1st, 22:00

Instructions

This assignment is to be done in INDIVIDUALLY. Follow the instructions in the lab manual for submitting assignments through the Virtual campus. (Question 1 should be answered in a Word file A1Q1.doc, question 2 in A2Q2.doc, and question 3 in A1Q3.doc. Question 4 requires you to implement a Java program in a file A1Q4.java and compile it in A1Q4.class. Zip all the .doc files and the .java file and .class file in a1_xxxxxx.zip, where xxxxxx is your student number, and submit it through the Virtual Campus).

Your algorithms should be developed using the format used in class, and it is not permitted to use structures such as branches and loops that have not yet been covered in the lectures. Your algorithm traces should use the format shown in class; a separate table is to be used for each call to each algorithm.

Marking Scheme (total 100 marks)

Question 1 (15 marks)

Assume that you intend to open a software store, but first you want to do a market study to find out the costs. Your research shows that the monthly basic expenses would be $8,500 (space rental, employees’ salaries, electricity, heating, taxes, etc.). To this cost you will need to add the cost of your merchandise. In average, the cost of a software package is estimated to $28.50 (including tax). You do not know exactly how many software packages you will be able to sell each month, and therefore you do not know how much merchandise to buy (the number of software packages that you plan to buy is the estimated number of sales plus 200 packages, in order to make sure that you have enough merchandise at the end of the month or in case the sales are bigger than your expectations).

                                                                                                
a) Write an algorithm that calculates your total monthly expenses, given an estimated number of sales (software packages) per month.

b) Trace your algorithm for an estimated number of 1500 sales per month.

Question 2 (15 marks)

a) You want to establish a relation between the profit that you hope to have each month and the average sale price of a software package in your store.  Design an algorithm that calculates the average sale price of a software package, given a desired profit, an estimation of your total monthly costs, and an estimated number of sales per month. To do this, you need to first calculate the necessary income given your desired profit and your total monthly costs, then to divide this income by the estimated number of sales per month. 

b) Trace your algorithm to find the sale price you should ask for a software package, in order to obtain a desired profit of $5,000, if the total monthly cost is $45,900 and the estimated number of sales is 1,000 software packages per month.

 

Question 3 (30 marks)

Using your algorithms from Question 1 and Question 2, write an algorithm to calculate the increase of the sale price of a software package needed in order to increase your profit from a current desired profit value to a larger desired value (for example from $5,000 to $6,000), given an estimated sales per month (therefore this algorithm takes three given variables). Note that the total monthly costs should be calculated by calling the algorithm from Question 1 (assume that the basic monthly costs and the average cost of a software package are the same as in Question 1), and the sales prices should be calculated by calling the algorithm from Question 2.

 

Question 4 (30 marks)

Implement a simple Java program to calculate your total monthly expenses, given an estimated number of software packages sold per month, using the algorithm from Question 1. The program should print the assignment and question number on one line, and your name and student number on another line. It should read one input variable from the keyboard (the number of software packages estimated to be sold per month), then it should call the method that implements the algorithm. After that it should print the result returned by the call.